package com.atguigu.aiproject.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("chat_session")
public class ChatSession {
    @TableId(type = IdType.AUTO)
    private Long id;
    @TableField(value = "user1_id")
    private Integer user1Id;
    @TableField(value = "user2_id")
    private Integer user2Id;
    @TableField(value = "last_message_id")
    private Long lastMessageId;
    @TableField(value = "last_message_content")
    private String lastMessageContent;
    @TableField(value = "last_message_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastMessageTime;
    @TableField(value = "unread_count")
    private Integer unreadCount;
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
